<style>
	.apply_body{
		background: #f4f4f4;
		width: 100%;
		height: 100%;
	}
	.apply_list{
		height: 325rpx;
		width: 100%;
		background: #fff;
		margin-bottom: 20rpx;
	}
	.apply_list:first-child{
		border-top: 2rpx solid #c9c9c9;
	}
	.order_no_box{
		height: 77rpx;
		line-height: 77rpx;
		width: 100%;
		border-bottom: 2rpx solid #c9c9c9;
	}
	.order_info{
		width: 95%;
		margin: 0 auto;
		height: 100%;
	}
	.order_no_left{
		float: left;
		font-size: 28rpx;
	}
	.order_no_right{
		float: right;
		font-size: 28rpx;
		color: #d71511;
	}
	.order_info_box{
		height: 171rpx;
		width: 100%;
		border-bottom: 2rpx solid #c9c9c9;
	}
	.order_img{
		float: left;
		width: 125rpx;
		height: 125rpx;
		margin-top: 24rpx;
		margin-right: 21rpx;
	}
	.order_img image{
		width: 100%;
		height: 100%;
		border: 2rpx solid #c9c9c9;
	}
	.order_desc{
		float: left;
		width: 392rpx;
	}
	.goods_name{
		font-size: 32rpx;
		width: 392rpx;
		height: 64rpx;
		line-height: 83rpx;
		margin-top: 6rpx;
	}
	.show_point{
		overflow:hidden;
		text-overflow:ellipsis;
		white-space:nowrap;
	}
	.goods_attr{
		font-size: 28rpx;
		color: #666;
		width: 392rpx;
		margin-top: 5rpx;
	}
	.goods_price{
		font-size: 32rpx;
	}
	.price_symbol{
		font-size: 26rpx;
		float: left;
		position: relative;
		top: 6rpx;
		margin-right: 3rpx;
	}
	.order_button{
		float: right;
		width: 155rpx;
		height: 61rpx;
		line-height: 61rpx;
		text-align: center;
		border: 2rpx solid #4d4d4d;
		border-radius: 10rpx;
		font-size: 30rpx;
		margin-top: 55rpx;
	}
	.money_status{
		text-align: right;
		color: #d71511;
		font-size: 30rpx;
		margin-top: 15rpx;
		margin-right: 20rpx;
	}
	.status_title{
		color: #333;
	}
	.apply_type{
		float: left;
		margin-left: 20rpx;
	}
	.m-no-data image{
		width: 100%;
		height: 100%;
	}
</style>
<template>
	<view class="apply_body">
		<view class="apply_list" v-for="(item,index) in orderData" :key="index">
			<view class="order_no_box">
				<view class="order_info">
					<view class="order_no_left">
						订单号：{{item.order_no}}
					</view>
					<view class="order_no_right">
						<text v-if="item.apply_status == 0">未审核</text>
						<text v-else-if="item.apply_status == 1">已审核</text>
						<text v-else>审核未通过</text>
					</view>
				</view>
			</view>
			<view class="order_info_box">
				<view class="order_info">
					<view class="order_img" @tap="refund_info(item.id)">
						<image :src="item.goods_img"></image>
					</view>
					<view class="order_desc" @tap="refund_info(item.id)">
						<view class="goods_name show_point">{{item.goods_name}}</view>
						<view class="goods_attr show_point">{{item.item_names}}</view>
						<view class="goods_price"><view class="price_symbol">¥</view>{{item.shop_price}}</view>
					</view>
					<!-- <view class="order_button">
						去弹换
					</view> -->
				</view>
			</view>
			<view class="money_status">
				<view class="apply_type">
					<text class="status_title">申请类型：</text>
					<text v-if="item.apply_type == 1">退款</text>
					<text v-else-if="item.apply_type == 2">退货</text>
					<text v-else>享退</text>
				</view>
				<view class="return_status" v-if="item.money_status != 0">
					<text class="status_title">退款状态：</text>
					<text v-if="item.money_status == 1">金额已退款</text>
					<text v-else>审核未通过</text>
				</view>
			</view>
		</view>
		<view class="m-loading" v-if="bIsShowLoading">
		    <image src="../../../static/images/loading.gif" mode="widthFix"></image>
		    <text>加载中</text>
		</view>
		<view class="m-no-data" v-if="showNodata">
			<image src="../../../static/images/jewel/no_refund_order.png" mode="widthFix"></image>
		</view>
	</view>
</template>

<script>
	import hl from '@/common/common_zb.js';
	export default {
		data() {
			return {
				page: 1,	// 当前页数
				totalPages: 1,	// 页数总数
				orderData: [],	// 订单数据
				bIsShowLoading: false,
				loadtype: 'normal',	// 加载数据方式
				showNodata: false
			}
		},
		onLoad() {
			this.get_refund_list({page: 1});
		},
		methods: {
			get_refund_list(data){
				let that = this;
				if(data.page <= that.totalPages){
					that.bIsShowLoading = true;
					hl.post('order/refund_list',data, true,function(res){
						that.bIsShowLoading = false;
						let res_data = res.data.data.data
						if (!res_data.length) {
							that.orderData = ''
							hl.showToast('暂无数据',1000);
							that.showNodata = true;
							return false;
						}
						if (that.loadtype == "plus") { // 上拉加载
							that.orderData = that.orderData.concat(res_data);
						} else {
							that.orderData = res_data;
							that.totalPages = res.data.count;
							uni.stopPullDownRefresh();
						}
					});
				}
			},
			refund_info(id){
				uni.navigateTo({
					url: '/pages/jewel/order/refund_info?order_id=' + id
				})
			}
		}
	}
</script>